package com.example.ch11eventanonymousclass

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    button3.setOnClickListener {
      Toast.makeText(this,"Hello World",Toast.LENGTH_LONG).show()
    }

    button3.setOnLongClickListener {
      Snackbar.make(root_layout,"Long Click",Snackbar.LENGTH_LONG).show()
      true
    }


  }
}
